<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        body{
            background-color: rgb(243, 242, 242);
        }
        .content{
            width: 80%;
            /* height: 1000px; */
            margin: 15px auto;
        }
        .section{
            margin-top: 30px;
            padding: 15px 20px;
            border-radius: 5px;
            background-color: #fff;
        }
        .title{
            margin-bottom: 8px;
        }
        hr{
            background-color: rgb(243, 242, 242);
            border: none;
            height: 1px;
        }
        .list{
            display: flex;
            width: 100%;
            flex-wrap: wrap;
            justify-content: space-around;
            /* height: 200px; */
        }
        .item{
            display: flex;
            width: 80%;
            height: 60px;
            margin-top: 15px;
            border: 1px rgb(243, 242, 242) solid;
            border-radius: 3px;
            align-items: center;
            cursor: pointer;
            transition: .3s all;
        }
        img{
            width: 25px;
            height: 25px;
        }
        .wrapper{
            width: 60%;
            font-size: 13px;
        }
        img, .wrapper{
            
            margin-left: auto;
        }
        .detail{
            font-size: 11px;
            color: #ccc;
            white-space:nowrap;
            overflow:hidden;
            text-overflow:ellipsis;
        }
        /* 最后空盒子 */
        .item:nth-last-child(-n + 2){
            height: 0;
            margin-top: 0;
            border: none;
        }
        /* 响应式 */
        @media (min-width: 768px) {
            .item{
                width: 45%;
            }
        }
        @media (min-width: 992px) {
            .item{
                width: 30%;
            }
        }
        @media (min-width: 1200px) {
            .item{
                width: 21%;
            }
        }
        .item:hover{
            margin-top: 10px;
            box-shadow: 0 10px 10px -10px #ccc
        }
    </style>
</head>
<body>
    <div class="content">
        <!-- <div class="section">
            <p class="title">必看</p>
            <hr>
            <div class="list">
                <div class="item">
                    <img src="../image/nav-new-img/be_s.png" alt="">
                    <div class="wrapper">
                        <p class="newsTitle">bbbebe</p>
                        <p class="detail">fasfafasdf</p>
                    </div>
                </div>
                <div class="item">
                    
                </div>
                <div class="item">
                    
                </div>
            </div>
        </div> -->
    </div>
    <script src="../jquery/jquery.min.js"></script>
    <script src="../data/nav_new.js"></script>
    <script>
        var arr = navData.linkBlocks;
        var str = '';
        for (var i = 0; i < arr.length; i++) {
            var data = arr[i];
            str += `<div class="section">
                        <p class="title">${data.name}</p>
                        <hr>
                    <div class="list">`;
            // 循环blocks
            for (let j = 0; j < data.blocks.length; j++) {
                var blocks = data.blocks;
                // 设置地址标识
                str += `<div class="item" onclick="target()" data-href="${blocks[j].href}">
                            <img src="../image/nav-new-img/${blocks[j].img}" alt="">
                            <div class="wrapper">
                                <p class="newsTitle">${blocks[j].title}</p>
                                <p class="detail">${blocks[j].desc}</p>
                            </div>
                        </div>`;
            }
            str += `<div class="item"></div><div class="item"></div></div></div>`;      
        }
        $('.content').html(str);
        function target() {
            window.open(event.currentTarget.dataset.href, '_blank')
        }
    </script>
</body>
</html>